package plus;

public class S_Intrinsic extends Solution {
	final String name;
	S_Intrinsic(String name) { this.name = name; }
	@Override public String toString() { return name; }
	@Override void conform_to(Solution that, Gamma gamma) { mustBe(that); }
	@Override void unify_with(Solution that) { mustBe(that); }
	@Override Solution copy() { return this; }
	@Override Type subst(Type[] actuals) { return Type.fresh(this); }
	@Override boolean isNullable() { return false; }
	private void mustBe(Solution that) {
		if (that != this) Type.mismatch(toString(), that.toString());
	}
	@Override boolean canConform(Solution that, Hypo h) {
		return name == ((S_Intrinsic)that).name;
	}
}
